package com.example.lawyer.databind.assembly;

import android.view.View;
import android.widget.GridView;
import android.widget.ListView;

import androidx.databinding.BindingAdapter;
import androidx.databinding.ObservableField;
import androidx.databinding.library.baseAdapters.BR;

import com.example.lawyer.R;
import com.example.lawyer.adapter.CurrentAdapters;
import com.example.lawyer.databind.itemview.MenuViewData;

import java.util.List;
import java.util.Map;

public class MyMenuData {



    public ObservableField<List<MenuViewData>> menudata = new ObservableField<>();



    @BindingAdapter("setamenydapter")
    public static void SetAdapter(View view,List<MenuViewData> data)
    {
        if(data!=null) {

            CurrentAdapters adapters = new CurrentAdapters(data, R.layout.item_assembly_gridview_menu, BR.menuviewdata);
            GridView gridView = (GridView) view;
            gridView.setAdapter(adapters);
        }else{
            System.out.println("空的");
        }

    }



}
